package com.druid.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.druid.entity.CeNavigation;
import com.druid.model.ResponseData;
import com.druid.service.managementservice.ICeNavigationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * @author druid-elf
 * @since 2019-12-25
 */
@Api(tags={"后台管理菜单导航表前端控制器"})
@RestController
@RequestMapping("/ceNavigation")
@RequiredArgsConstructor
public class CeNavigationController {

    private final ICeNavigationService iCeNavigationService;

    @ApiOperation("得到后台管理菜单导航表分页列表")
    @GetMapping(value = "getCeNavigationList")
    public ResponseData<List<CeNavigation>> getCeNavigationList() {

        return ResponseData.SUCCESS(
                iCeNavigationService.list(new LambdaQueryWrapper<CeNavigation>().orderByAsc(CeNavigation::getSort))
        );
    }
}
